package com.dynamixsoftware.printershare.smb.util;

public class RC4
{
  private int i;
  private int j;
  private byte[] s;
  
  public RC4() {}
  
  public RC4(byte[] paramArrayOfByte)
  {
    init(paramArrayOfByte, 0, paramArrayOfByte.length);
  }
  
  private void init(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    this.s = new byte[256];
    for (this.i = 0; this.i < 256; this.i = (1 + this.i)) {
      this.s[this.i] = ((byte)this.i);
    }
    this.j = 0;
    for (this.i = 0; this.i < 256; this.i = (1 + this.i))
    {
      this.j = (0xFF & this.j + paramArrayOfByte[(paramInt1 + this.i % paramInt2)] + this.s[this.i]);
      int k = this.s[this.i];
      this.s[this.i] = this.s[this.j];
      this.s[this.j] = k;
    }
    this.j = 0;
    this.i = 0;
  }
  
  public void update(byte[] paramArrayOfByte1, int paramInt1, int paramInt2, byte[] paramArrayOfByte2, int paramInt3)
  {
    int k = paramInt1 + paramInt2;
    int m = paramInt3;
    int i3;
    for (int n = paramInt1; n < k; n = i3)
    {
      this.i = (0xFF & 1 + this.i);
      this.j = (0xFF & this.j + this.s[this.i]);
      int i1 = this.s[this.i];
      this.s[this.i] = this.s[this.j];
      this.s[this.j] = i1;
      int i2 = m + 1;
      i3 = n + 1;
      paramArrayOfByte2[m] = ((byte)(paramArrayOfByte1[n] ^ this.s[(0xFF & this.s[this.i] + this.s[this.j])]));
      m = i2;
    }
  }
}


/* Location:           C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar.jar
 * Qualified Name:     com.dynamixsoftware.printershare.smb.util.RC4
 * JD-Core Version:    0.7.0.1
 */